package collection;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;

public class ListDemo1 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("one");
        list.add("two");
        list.add("three");
        list.add("four");
        list.add("five");
        list.set(2,"six");
        System.out.println(list);
        int len = list.size();
        for (int i = 0; i < len / 2; i++) {
        list.set(i, list.set(len - 1 - i,list.get(i)));
        }
        System.out.println(list);
        Collections.reverse(list);
        System.out.println(list);
        list.remove(3);
    }
}
